{include file=header.html}
<script type="text/javascript" src="{lib file=search_store.js}" charset="utf-8"></script>
<script type="text/javascript">
//<!CDATA[
$(function (){
	
    var order = '{$smarty.get.order}';
	var css = '';
	
	<!--{if $smarty.get.order}-->
	order_arr = order.split(' ');
	switch (order_arr[1]){
		case 'desc' : 
			css = 'order-down btn-order-cur';
		break;
		case 'asc' :
			css = 'order-up btn-order-cur';
		break;
		default : 
			css = 'order-down-gray';
	}
	$('.btn-order a[ectype='+order_arr[0]+']').attr('class','btn-order-click '+css);
	<!--{/if}-->
	
	$(".btn-order a").click(function(){
		if(this.id==''){
			dropParam('order');// default order
			return false;
		}
		else
		{
			dd = " desc";
			if(order != '') {
				order_arr = order.split(' ');
				if(order_arr[0]==this.id && order_arr[1]=="desc")
					dd = " asc";
				else dd = " desc";
			}
			replaceParam('order', this.id+dd);
			return false;
		}
	});
	
	$('.list-fields li .row_3 a').click(function(){
		var cl=$(this).attr('class');
		if(cl=='expand'){
			$(this).attr('class','fold');	
			$(this).html('{$lang.pull_goods}');
		}else{
			$(this).attr('class','expand');	
			$(this).html('{$lang.expand_goods}');
		}
		$(this).parent().parent().parent('.store-info').next('.store-goods').toggle();
	});
	
	$('.search-by .show-more').click(function(){
		$(this).parent().children().find('.toggle').toggle();
		if($(this).find('span').html()=='{$lang.expand}'){
			$(this).find('span').html('{$lang.fold}');
			$(this).children().children('i').css('background-position','0 -1488px');
		} else {
			$(this).find('span').html('{$lang.expand}');
			$(this).children().children('i').css('background-position','0 -1497px');
		}
	});
	
});

//]]>
</script>
<div id="main" class="w-full">
<div id="page-search-store" class="w mt10 mb10">  
	{include file=curlocal.html}
    <div class="w mb10 border">
        <div class="search-by by-category relative">
			<!--{foreach from=$scategorys item=scategory name=fe_scategory}-->
			<dl class="relative clearfix">
				<dt class="float-left"><a href="{url app=search&act=store&cate_id=$scategory.id}">{$scategory.value|escape}</a></dt>
				<dd class="float-left">
					<!--{if $scategory.children}-->
					<!--{foreach from=$scategory.children item=child name=fe_child}-->
					<a href="{url app=search&act=store&cate_id=$child.id}" class="{if $smarty.foreach.fe_child.iteration gt 7}toggle hidden{/if}">{$child.value|escape}</a>
                    <!--{/foreach}-->
                    <!--{else}-->
                    &nbsp;
					<!--{/if}-->
				</dd>
                <dd class="float-left show-more"><h3 class="pointer clearfix"><i></i><span>展开</span>分类</span></h3></dd>
			</dl>
			<!--{/foreach}-->
		</div>
		<div class="search-by by-region relative clearfix">
			<dl class="clearfix" style="border-bottom:0">
				<dt class="float-left"><a ectype="region" id="" href="javascript:;">{$lang.region_name}</a></dt>
				<dd class="float-left">
					<!--{foreach from=$regions item=region key=key name=fe_region}-->
					<a href="javascript:;" ectype="region" id="{$key}" class="{if $smarty.foreach.fe_region.iteration ge 9}toggle hidden{/if}">{$region|escape}</a>
					<!--{foreachelse}-->
                    &nbsp;
					<!--{/foreach}-->
				</dd>
                <dd class="float-left show-more"><h3 class="pointer clearfix"><i></i><span>展开</span>地区</h3></dd>
			</dl>
			
        </div>  
    </div>
    <div class="shops-list w clearfix">
			<div class="search-type clearfix">
				<div class="float-left btn-type">
					<a href="{url app=search}">搜索商品</a>
					<a href="{url app=search&act=store}" class="current" style="border-right:0px;">搜索店铺</a>
					<a href="{url app=search&act=groupbuy}">搜索团购</a>
				</div>
				{include file=page.top.html}                              
			</div>
            <div  class="sort-type padding5 border border-t-0  mb10 clearfix">
               <div class="clearfix float-left btn-order">
                    <a class="btn-order-click default-sort" id="" href="javascript:;">{$lang.default_sort}</a>
                    <a class="btn-order-click order-down-gray" id="credit_value" href="javascript:;">{$lang.credit_grade}<i></i></a>
                    <a class="btn-order-click order-down-gray" id="add_time" href="javascript:;">{$lang.add_time}<i></i></a>
                    <a class="btn-order-click order-down-gray" id="praise_rate" href="javascript:;">{$lang.praise_rate}<i></i></a>
                    <a class="btn-order-click order-down-gray" id="region_name" href="javascript:;">{$lang.region_name}<i></i></a>
                </div>
               <div class="clearfix float-right">
                    <a class="select-param"  href="javascript:;">
                    	{$lang.credit_grade}
                        <span><i></i></span>
                        <ul class="tan" ectype="credit_value">
                        	<li v="4">{$lang.goldens}</li>
                        	<li v="3">{$lang.crowns}</li>
                            <li v="2">{$lang.diamonds}</li>
                            <li v="1">{$lang.hearts}</li>
                            <li v="">{$lang.no_limit}</li>
                        </ul>
                    </a>
                    <a class="select-param"  href="javascript:;">
                    	{$lang.recommended}
                        <span><i></i></span>
                        <ul class="tan" ectype="recommended">
                        	<li v="1">{$lang.yes}</li>
                        	<li v="0">{$lang.no}</li>
                            <li v="">{$lang.no_limit}</li>
                        </ul>
                    </a>
                    <a class="select-param"  href="javascript:;">
                    	{$lang.praise_rate}
                        <span><i></i></span>
                        <ul class="tan" ectype="praise_rate">
                        	<li v="90">{$lang.gt90}</li>
                        	<li v="80">{$lang.gt80}</li>
                            <li v="70">{$lang.gt70}</li>
                            <li v="60">{$lang.gt60}</li>
                            <li v="50">{$lang.gt50}</li>
                            <li v="">{$lang.no_limit}</li>
                        </ul>
                    </a>
                    <a class="select-param"  href="javascript:;">
                        {$lang.sgrade}
                        <span><i></i></span>
                        <ul class="tan" ectype="sgrade">
                        	<!--{foreach from=$sgrades item=sgrade key=key}-->
                        	<li v="{$key}">{$sgrade}</li>
                            <!--{/foreach}-->
                            <li v="">{$lang.no_limit}</li>
                        </ul>
                    </a>
                </div>
            </div>
            <div class="list-fields w mb10">
				<ul>
					<!--{foreach from=$stores item=store}-->
            		<li class="pb5 pt5">
						<div class="store-info clearfix">
							<div class="row_1 float-left"><a href="{url app=store&id=$store.store_id}"><img src="{$store.store_logo}" width="80" height="80" /></a></div>
                            <div class="row_2 float-left">
                                <h2><a href="{url app=store&id=$store.store_id}">{$store.store_name|escape}</a></h2>
                                <div class="mainbussiness">
                                    <span>{$lang.mainbussiness}{$lang.colon}</span><a href="{url app=store&id=$store.store_id}">{$store.business_scope}</a>
                                </div>
                                <div class="owner_info">
                                    <span>{$lang.owner}{$lang.colon}</span>
                                    <a href="{url app=store&id=$store.store_id}">{$store.user_name|escape}</a>
                                    <!--{if $store.im_qq}-->
                                    <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin={$store.im_qq}&site=qq&menu=yes"><img width="65" border="0" src="http://wpa.qq.com/pa?p=2:{$store.im_qq}:1" align="absMiddle"></a>				
                                    <!--{/if}-->
                                    <!--{if $store.im_ww}-->
                                    <a target="_blank" href="http://dafu123.taobao.com/webww/ww.php?ver=3&touid={$store.im_ww}&siteid=cntaobao&status=1&charset=utf-8"><img border="0" src="http://amos.alicdn.com/realonline.aw?v=2&uid={$store.im_ww}&site=cntaobao&s=1&charset=utf-8" align="absMiddle"/></a>
                                    <!--{/if}-->
                                </div>
                            </div>
                            <div class="row_3 float-left">
                                <p>{$lang.gong}<b>{$store.goods_count}</b>{$lang.count_of_goods}</p>
                                <p>{$lang.store_all_sold}<b>{$store.store_sold}</b>{$lang.count_of_goods}</p>
                                <p><a class="fold" href="javascript:;">{$lang.pull_goods}</a></p>
                            </div>
                            <div class="row_4 float-left">{$store.region_name|escape}</div>
                            <div class="row_5 float-right">
                                <p>
                                    <!--{if $store.credit_value ge 0}-->
                                    <img src="{$store.credit_image}" />
                                    <!--{else}-->
                                    {$store.credit_value}
                                    <!--{/if}-->
                                </p>
                                <p>{$store.sgrade_name}</p>
                                <p>{$lang.praise_rate}:{$store.praise_rate}%</p>
                            </div>
                        </div>
                        <!--{if $store.goods_list}-->
						<div class="store-goods mt5 mb5 carousel-{$store.store_id}">
                            <b></b>
							<a class="prev" href="javascript:;"></a>
							<a class="next" href="javascript:;"></a> 
                            <div class="clr"></div><!--for ie -->
							<div class="scroller">
								<div class="ks-switchable-content">
									<!--{foreach from=$store.goods_list item=list} -->
                                    <div class="each clearfix">
                                    <!--{foreach from=$list item=goods} -->
									<dl>
										<dt><a href="{url app=goods&id=$goods.goods_id}" target="_blank"><img width="160" height="160" src="{$goods.default_image}" /></a></dt>
										<dd>
											<div class="desc"><a href="{url app=goods&id=$goods.goods_id}" target="_blank">{$goods.goods_name}</a></div>
											<div class="price"><span>{$goods.price|price}</span></div>
										</dd>
									</dl>
                                    <!-- {/foreach} -->
                                    </div>
									<!-- {/foreach} -->
								</div>
							</div>
						</div>
                        <script>
						KISSY.use("switchable", function(S) {
						var tiny_slide = new S.Carousel('.carousel-{$store.store_id}', {
							//steps:5,
							effect: 'scrollx',
							circular: true,
							prevBtnCls: 'prev',
							nextBtnCls: 'next',
							autoplay:true
							});
						});
					</script>
                        <!--{/if}-->
					</li>	
                    <!-- {foreachelse} -->
             		<div class="store-empty padding10 mb10">{$lang.no_store}</div>
                    <!--{/foreach}-->
            	</ul>
            </div>
         
        {include file=page.bottom.html}
    </div>
</div>
</div>	
{include file=server.html}					
{include file=footer.html}